<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript 弹窗-换行</title>

</head>

<body>
    <!-- 弹窗使用 反斜杠 + "n"(\n) 来设置换行。 -->

    <p>点击按钮在弹窗中使用换行。</p>
    <button onclick="myFunction()">点我</button>
    <p id="demo"></p>
    <script>
        function myFunction() {
            alert("Hello\nHow are you?");
        }
    </script>
</body>

</html>